<template>
  <div id="building">
    <div class="personal-img">
      <img src="../../static/personal.png" alt="" />
    </div>

    <el-divider></el-divider>
    <!-- 左侧导航栏 -->
    <div class="left">
      <div
        :class="['item', index === active ? 'active' : '']"
        v-for="(item, index) in list"
        :key="index"
        @click="tab(index)"
      >
        {{ item }}
      </div>
    </div>
    <!-- 右侧详情 -->
    <div class="right"></div>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      active: 0,
      list: ["首页", "订单中心", "个人信息", "修改密码", "收货地址管理"],
    };
  },
  methods: {
    tab(i) {
      this.active = i;
    },
  },
};
</script>
<style scoped>
#building {
  min-height: 5.5rem;
}
.personal-img {
  padding: 3% 0 1% 3%;
}
.personal-img img {
  width: 30%;
}
.left {
  width: 25%;
}
.item {
  box-sizing: border-box;
  padding: 9% 0 9% 33%;
  font-size: 0.14rem;
  cursor: pointer;
}
.active {
  color: #fff;
  background-color: rgb(229, 0, 18);
}
.right {
  width: 75%;
}
</style>

<style>
#building .el-divider--horizontal {
  margin: 0;
}
</style>